package diffsquares

import (
	"math"
)

const testVersion = 1

// SquareOfSums
func SquareOfSums(input int) (sum int) {
	t := 0
	for i := 1; i < input+1; i++ {
		t += i
	}
	sum = int(math.Pow(float64(t), 2))
	return
}

// SumOfSquares
func SumOfSquares(input int) (sum int) {
	var tSum float64
	for i := 1; i < input+1; i++ {
		tSum += math.Pow(float64(i), 2)
	}

	sum = int(tSum)
	return
}

func Difference(input int) (diff int) {
	diff = SquareOfSums(input) - SumOfSquares(input)
	return
}
